import request from '@/utils/request'

//章节小节模块
export default {
  //根据courseId查询所有章节小节
  findAllByCourseId(courseId){
    return request({
      url: `/eduservice/chapter/findByCourseId/${courseId}`,
      method: 'get'
    })
  },
  //添加章节
  addChapter(chapter){
    return request({
      url: `/eduservice/chapter/add`,
      method: 'post',
      data:chapter
    })
  },
  //根据id查询chapter
  findById(id){
    return request({
      url: `/eduservice/chapter/findById/${id}`,
      method: 'get'
    })
  },
  //修改chapter
  update(chapter){
    return request({
      url: `/eduservice/chapter/update`,
      method: 'post',
      data:chapter
    })
  },
  //根据id删除chapter
  deleteById(id){
    return request({
      url: `/eduservice/chapter/deleteById/${id}`,
      method: 'get'
    })
  }
}
